<?php

class Meta {

    private $name;
    private $content;

    public function __construct($name, $content) {
        $this->name = $name;
        $this->content = $content;
    }

    public function getAttributes() {
        static $httpEquiv = array('content-type', 'expires', 'refresh',
                'set-cookie');

        if(in_array($this->name, $httpEquiv)) {
            return array('http-equiv' => $this->name, 'content' => $this->content);
        }
        return array('name' => $this->name, 'content' => $this->content);
    }
}

class Link {

    private $attributes;
    public $ie_cond;

    public function __construct($attributes, $ie_cond = null) {
        $this->attributes = $attributes;
        $this->ie_cond = $ie_cond;
    }

    public function getAttributes() {
        if(is_array($this->attributes)) {
            return $this->attributes;
        }
    }
}

class Script {
    private $type;
    private $src;
    private $content;
    public $ie_cond;

    public function __construct($type, $src = null, $content = '',
            $ie_cond = null) {
        $this->type = $type;
        $this->src = $src;
        $this->content = $content;
        $this->ie_cond = $ie_cond;
    }

    public function getAttributes() {
        $attr = array('type' => $this->type);
        if(!is_null($this->src)) {
            $attr['src'] = $this->src;
        }
        return $attr;
    }

    public function getContent() {
        if(is_string($this->content)) {
            return $this->content;
        }
        return '';
    }

}

class Style {
    
    private $attributes;
    private $content;

    public function __construct($attributes, $content) {
        $this->attributes = $attributes;
        $this->content = $content;
    }

    public function getAttributes() {
        if(is_array($this->attributes)) {
            return $this->attributes;
        }
    }

    public function getContent() {
        if(is_string($this->content)) {
            return $this->content;
        }
    }

}
